﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ground : MonoBehaviour
{
    Vector3 movement;
    GameObject left;
    public float speed=12;
    void Start()
    {
        movement.x=speed;
        left=GameObject.Find("left");
    }

    // Update is called once per frame
    void Update()
    {
        MoveGround();
    }
    void MoveGround(){
        transform.position-=movement*Time.deltaTime;
        if(transform.position.x<=left.transform.position.x)Destroy(gameObject);
    }
}
